package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysEmailMapper;
import com.ruoyi.system.domain.SysEmail;
import com.ruoyi.system.service.ISysEmailService;

/**
 * 发邮件Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-09-24
 */
@Service
public class SysEmailServiceImpl implements ISysEmailService 
{
    @Autowired
    private SysEmailMapper sysEmailMapper;

    /**
     * 查询发邮件
     * 
     * @param elId 发邮件主键
     * @return 发邮件
     */
    @Override
    public SysEmail selectSysEmailByElId(Long elId)
    {
        return sysEmailMapper.selectSysEmailByElId(elId);
    }

    /**
     * 查询发邮件列表
     * 
     * @param sysEmail 发邮件
     * @return 发邮件
     */
    @Override
    public List<SysEmail> selectSysEmailList(SysEmail sysEmail)
    {
        return sysEmailMapper.selectSysEmailList(sysEmail);
    }

    /**
     * 新增发邮件
     * 
     * @param sysEmail 发邮件
     * @return 结果
     */
    @Override
    public int insertSysEmail(SysEmail sysEmail)
    {
        sysEmail.setCreateTime(DateUtils.getNowDate());
        return sysEmailMapper.insertSysEmail(sysEmail);
    }

    /**
     * 修改发邮件
     * 
     * @param sysEmail 发邮件
     * @return 结果
     */
    @Override
    public int updateSysEmail(SysEmail sysEmail)
    {
        sysEmail.setUpdateTime(DateUtils.getNowDate());
        return sysEmailMapper.updateSysEmail(sysEmail);
    }

    /**
     * 批量删除发邮件
     * 
     * @param elIds 需要删除的发邮件主键
     * @return 结果
     */
    @Override
    public int deleteSysEmailByElIds(Long[] elIds)
    {
        return sysEmailMapper.deleteSysEmailByElIds(elIds);
    }

    /**
     * 删除发邮件信息
     * 
     * @param elId 发邮件主键
     * @return 结果
     */
    @Override
    public int deleteSysEmailByElId(Long elId)
    {
        return sysEmailMapper.deleteSysEmailByElId(elId);
    }
}
